home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ Apr 89 / T0023-Re Overriding NEW-Apr89 < prev    next >
Encoding:
Text File  |  1989-04-18  |  1.6 KB  |  50 lines  |  [TEXT/GEOL]

  1. Item    8705940                         17-April-89        18:41
  2.  
  3. From:   ROLLIN1                         Rollin, Keith A.
  4.  
  5. To:     MACAPP.TECH$                    MACAPP Tech
  6.  
  7. Sub:    Re- Overriding NEW
  8.  
  9. To: R Andrews, Command Central, D2987,
  10.  
  11. The easiest way to not create a new document when starting an application is to
  12. override your TApplication.HandleFinderRequest thus:
  13.  
  14. PROCEDURE TYourApplication.HandleFinderRequest; OVERRIDE;
  15. BEGIN
  16.     IF gFileCount > 0 THEN
  17.         INHERITED HandleFinderRequest;
  18. END;
  19.  
  20. This way, documents get opened if you double-click on their icons, but no new
  21. document is created if you double-click on the application's icon.
  22.  
  23.  
  24. In the second part, I assume that you are talking about implementing the
  25. following sequence of event:
  26.  
  27. 1. The user selects New in the File menu.
  28.  
  29. 2. They are presented with the following dialog box:
  30.  
  31.         +---------------------------------------------+
  32.         | This game will severely affect your grades  |
  33.         | and ruin your chances of ever going to      |
  34.         | college. Are you sure you want to do this?  |
  35.         |                                             |
  36.         |      Yes!              I guess not...       |
  37.         +---------------------------------------------+
  38.  
  39. 3. The user presses "Yes!", or just presses "I guess not..."
  40.  
  41. You can do this by overriding TYourApplication.OpenNew. First of all, create
  42. your dialog box and call PoseModally for it. If the user clicked on "Yes!",
  43. then call INHERITED OpenNew, creating your document.
  44.  
  45. Hope this helps,
  46.  
  47. - Keith Rollin
  48. - Apple Developer Technical Support
  49.  
  50.